<template>
  <div style="height: calc(100vh - 90px)">
    <!--  -->
    <crumbs @goBack="() => {}" :superiorMenu="['生产报表']" currentMenu="计件工资统计" style="margin-bottom: 12px">
      <span slot="content">
        <div class="topSearch">
          <a-form-model ref="ruleForm" layout="inline" :model="filterForm">
            <a-form-model-item label="报工日期">
              <a-range-picker
                :allowClear="true"
                v-model="dateForm['reportWorkTime']"
                :disabled-date="disabledDate"
                style="width: 100%"
                @change="(v) => onOk(v)"
                @calendarChange="calendarChange"
              />
            </a-form-model-item>
            <a-button @click="handleShowFilter" style="margin-top: 4px" icon="filter"
              >筛选 <span class="filter-num" style="margin-left: 5px">{{ ' ' + filteredNums }}</span></a-button
            >
          </a-form-model>
        </div>
      </span>
    </crumbs>
    <!-- 头部模块 -->
    <a-card :bordered="false">
      <div class="topBox">
        <div class="itemBox" v-for="(item, index) in topArray" :key="index">
          <div class="rightBox">
            <div class="rightBot">
              {{ item.title }}
            </div>
            <div class="rightTop">{{ item.number }}</div>
          </div>
        </div>
      </div>
    </a-card>
    <div style="height: 12px; background: #f0f2f5"></div>

    <a-card :bordered="false" style="height: calc(100vh - 416px)">
      <!-- 操作按钮区域 -->
      <div class="table-operator">
        <a-button @click="showColumn" icon="unordered-list" style="margin-right: 10px"> 设置列 </a-button>
        <a-button @click="handleExport(selectedRows)" type="primary" style="float: right" icon="upload">导出</a-button>
      </div>
      <div>
        <a-table
          size="middle"
          :key="tableKey"
          :scroll="{ x: scrollX, y: 'calc(100vh - 550px)' }"
          :hideDefaultSelections="false"
          :columns="columns"
          :dataSource="modelList"
          :pagination="false"
          @change="tableChange"
          class="j-table-force-nowrap"
          :components="drag(columns, 'PIECE_RATE_STATISTICS')"
        >
          <!-- 行信息 -->
          <span slot="actions" slot-scope="text, record">
            <a @click="handleDetail(record, '/workManagement/piecePayDetails', '/pieceRateStatistics')"
              >查看明细</a
            >
            <!-- <a v-if="record.flowStatus == 'AGREE'" @click="handleEdit(record)">打印</a> -->
          </span>
          <!-- 输入框搜索 -->
          <div slot="searchInput" slot-scope="{ selectedKeys, confirm, clearFilters, column }" class="searchWorkOreder">
            <a-input
              placeholder="请输入"
              v-model="filterForm[column.dataIndex]"
              style="width: 188px; display: block"
              @pressEnter="handleSearch"
            />
            <a-button
              type="primary"
              style="width: 80px; margin-left: 20px; display: block"
              @click="() => handleSearch(selectedKeys, confirm, column.dataIndex, clearFilters)"
            >
              搜索
            </a-button>
          </div>
          <a-icon
            slot="searchIcon"
            slot-scope="filtered"
            type="search"
            :style="{ color: filtered ? '#108ee9' : undefined }"
          />
        </a-table>
      </div>
      <SetColumn
        columnName="设置列"
        ref="SetColumn"
        v-if="showSetColumn"
        @sureBtn="sureBtn"
        @cancelBtn="showSetColumn = false"
      />
    </a-card>
    <a-drawer placement="right" width="500" :visible="showFilter" @close="closeFilter">
      <div class="filter-body">
        <div slot="title" class="uni-card filter-tit">
          筛选 <span class="filter-num">{{ filteredNums }}</span>
        </div>
        <div class="uni-card" v-if="filteredNums > 0" style="background: #fff">
          <div v-for="(item, i) in filteredList" :key="i" v-show="item.text" class="tag-wrap">
            <span class="filter-tag" @click="delFiltered(item.key)">
              <span class="tag-text">{{ `${item.title}：${item.text}` }}</span>
              <a-icon type="close" style="float: right" />
            </span>
          </div>
        </div>
        <div style="overflow-y: scroll; flex: 1; padding: 0">
          <div class="uni-card" style="background: #fff">
            <a-form-model ref="ruleForm" layout="vertical" :model="filterForm">
              <a-form-model-item label="操作人">
                <a-input v-model="filterForm.operator" placeholder="请输入" />
              </a-form-model-item>
              <a-form-model-item label="报工日期">
                <a-range-picker
                  style="width: 100%"
                  v-model="dateForm['reportWorkTime']"
                  format="YYYY-MM-DD"
                  :placeholder="['开始时间', '结束时间']"
                  :allowClear="true"
                  @change="(v) => onOk(v)"
                  :disabled-date="disabledDate"
                  @calendarChange="calendarChange"
                />
              </a-form-model-item>
            </a-form-model>
          </div>
        </div>
        <div class="footer-submit">
          <a-button class="margin-btn" @click="resetFilter">重置</a-button>
          <a-button type="primary" @click="handleFilter">确定</a-button>
        </div>
      </div>
    </a-drawer>
    <!-- 全选/分页 -->
    <div
      class="uni-card"
      :style="{
        position: 'fixed',
        bottom: 0,
        left: 0,
        zIndex: 2,
        width: '100%',
        background: '#fff',
        padding: '24px',
      }"
    >
      <div style="display: inline-block; margin-left: 242px">
        <span>
          {{ `共 ${total} 条` }}
        </span>
      </div>
      <div style="display: inline-block; float: right">
        <a-pagination
          :total="total"
          v-model="current"
          :page-size-options="pageSizeOptions"
          :page-size="pageSize"
          @change="onChangePage"
          @showSizeChange="onShowSizeChange"
          show-quick-jumper
          show-size-changer
        />
      </div>
    </div>
    <a-modal style="width: 50%" v-model="selectExportVisiable" title="导出">
      <template slot="footer">
        <a-button key="back" @click="handleExportAll"> 导出全部数据 </a-button>
        <a-button key="submit" type="primary" @click="handleSelectExport"> 导出选中数据 </a-button>
      </template>
      {{ selectExportTitle }}
    </a-modal>
  </div>
</template>
<script>
import SetColumn from '@/pubComponent/SetColumn.vue'
import crumbs from '@/components/crumbs.vue'
import { getNewColumns, subStrText, commafyTofixed } from '@/utils/util'
import { API } from '@/api/requestFzs'
import moment from 'moment'
import { downFilePost } from '@/api/manage'
import { mapState } from 'vuex'
import tableDragResize from '@/mixins/tableDragResize'
// 表头
const columnsValue = [
  {
    title: '操作人',
    width: 100,
    ellipsis: true,
    dataIndex: 'operator',
    scopedSlots: {
      filterDropdown: 'searchInput',
      filterIcon: 'searchIcon',
      customRender: 'operator',
    },
  },
  {
    title: '总工资（元）',
    width: 150,
    ellipsis: true,
    sorter: true,
    dataIndex: 'totalWagesText',
    sortKey: 'totalWages',
    scopedSlots: { customRender: 'totalWagesText' },
  },
  {
    title: '合格品工资（元）',
    dataIndex: 'qualifiedWagesText',
    width: 150,
    ellipsis: true,
    scopedSlots: {
      customRender: 'qualifiedWagesText',
    },
  },
  {
    title: '不合格品工资（元）',
    dataIndex: 'noQualifiedWagesText',
    width: 150,
    ellipsis: true,
    scopedSlots: {
      customRender: 'noQualifiedWagesText',
    },
  },
  {
    title: '报工总数（基本单位）',
    width: 180,
    dataIndex: 'reportWorkNumBaseUnitText',
    sortKey: 'reportWorkNumBaseUnit',
    sorter: true,
    ellipsis: true,
    scopedSlots: { customRender: 'reportWorkNumBaseUnitText' },
  },
  {
    title: '报工总数（报工单位）',
    width: 180,
    dataIndex: 'reportWorkNumReportWorkUnitText',
    sortKey: 'reportWorkNumReportWorkUnit',
    sorter: true,
    ellipsis: true,
    scopedSlots: { customRender: 'reportWorkNumReportWorkUnitText' },
  },
  {
    title: '合格数（基本单位）',
    width: 180,
    dataIndex: 'qualifiedNumBaseUnitText',
    ellipsis: true,
    scopedSlots: { customRender: 'qualifiedNumBaseUnitText' },
  },
  {
    title: '合格数（报工单位）',
    width: 180,
    dataIndex: 'qualifiedNumReportWorkUnitText',
    ellipsis: true,
    scopedSlots: { customRender: 'qualifiedNumReportWorkUnitText' },
  },
  {
    title: '不合格数（基本单位）',
    width: 180,
    dataIndex: 'noQualifiedNumBaseUnitText',
    ellipsis: true,
    scopedSlots: { customRender: 'noQualifiedNumBaseUnitText' },
  },
  {
    title: '不合格数（报工单位）',
    width: 180,
    dataIndex: 'noQualifiedNumReportWorkUnitText',
    ellipsis: true,
    scopedSlots: { customRender: 'noQualifiedNumReportWorkUnitText' },
  },
]
const actionArr = [
  {
    fixed: 'right',
    title: '操作',
    align: 'left',
    width: 100,
    dataIndex: 'actions',
    ellipsis: true,
    scopedSlots: { customRender: 'actions' },
  },
]
let signStart = moment().startOf('month').format('YYYY-MM-DD HH:mm:ss')
let signEnd = moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')
export default {
  mixins: [tableDragResize],
  data() {
    return {
      selectExportTitle: '',
      selectExportVisiable: false, // 导出弹窗
      selectExportParam: {}, // 导出参数
      filedKeys: '', // 导出字段
      fileName: '', // 导出文件名
      // 头部配置
      topArray: [
        {
          title: '工资合计（元）',
          number: '0',
        },
        {
          title: '合格品工资（元）',
          number: '0',
        },
        {
          title: '不合格品工资（元）',
          number: '0',
        },
      ],
      commafyTofixed,
      moment,
      selectedRows: [],
      subStrText,
      showFilter: false, // 筛选抽屉
      modelList: [], // 列表数据
      showSetColumn: false, // 显示
      //全选按钮
      current: 1,
      total: 0,
      pageSize: 10,
      pageSizeOptions: ['10', '20', '30', '40', '50'],
      columnsValue,
      columns: [
        {
          title: '操作人',
          width: 100,
          ellipsis: true,
          dataIndex: 'operator',
          scopedSlots: {
            filterDropdown: 'searchInput',
            filterIcon: 'searchIcon',
            customRender: 'operator',
          },
        },
        {
          title: '总工资（元）',
          width: 150,
          ellipsis: true,
          sorter: true,
          dataIndex: 'totalWagesText',
          sortKey: 'totalWages',
          scopedSlots: { customRender: 'totalWagesText' },
        },
        {
          title: '合格品工资（元）',
          dataIndex: 'qualifiedWagesText',
          width: 150,
          ellipsis: true,
          scopedSlots: {
            customRender: 'qualifiedWagesText',
          },
        },
        {
          title: '不合格品工资（元）',
          dataIndex: 'noQualifiedWagesText',
          width: 150,
          ellipsis: true,
          scopedSlots: {
            customRender: 'noQualifiedWagesText',
          },
        },
        {
          title: '报工总数（基本单位）',
          width: 180,
          dataIndex: 'reportWorkNumBaseUnitText',
          sortKey: 'reportWorkNumBaseUnit',
          sorter: true,
          ellipsis: true,
          scopedSlots: { customRender: 'reportWorkNumBaseUnitText' },
        },
        {
          title: '报工总数（报工单位）',
          width: 180,
          dataIndex: 'reportWorkNumReportWorkUnitText',
          sortKey: 'reportWorkNumReportWorkUnit',
          sorter: true,
          ellipsis: true,
          scopedSlots: { customRender: 'reportWorkNumReportWorkUnitText' },
        },
        {
          title: '合格数（基本单位）',
          width: 180,
          dataIndex: 'qualifiedNumBaseUnitText',
          ellipsis: true,
          scopedSlots: { customRender: 'qualifiedNumBaseUnitText' },
        },
        {
          title: '合格数（报工单位）',
          width: 180,
          dataIndex: 'qualifiedNumReportWorkUnitText',
          ellipsis: true,
          scopedSlots: { customRender: 'qualifiedNumReportWorkUnitText' },
        },
        {
          title: '不合格数（基本单位）',
          width: 180,
          dataIndex: 'noQualifiedNumBaseUnitText',
          ellipsis: true,
          scopedSlots: { customRender: 'noQualifiedNumBaseUnitText' },
        },
        {
          title: '不合格数（报工单位）',
          width: 180,
          dataIndex: 'noQualifiedNumReportWorkUnitText',
          ellipsis: true,
          scopedSlots: { customRender: 'noQualifiedNumReportWorkUnitText' },
        },
        // {
        //   fixed: 'right',
        //   title: '操作',
        //   align: 'left',
        //   width: 100,
        //   dataIndex: 'actions',
        //   ellipsis: true,
        //   scopedSlots: { customRender: 'actions' },
        // },
      ],
      filterForm: {
        operator: '',
        reportWorkTime: '',
        reportWorkTimeBegin: signStart,
        reportWorkTimeEnd: signEnd,
      },
      filteredFormLable: {
        operator: '操作人',
        reportWorkTime: '报工日期',
      },
      sortForm: {
        sortType: '',
        sortColumn: '',
      },
      dateForm: {
        reportWorkTime: [moment().startOf('month'), moment()],
      } /* 筛选日期绑定对象 */,
      calendarDate: null,
      tableKey: 1.9
    }
  },
  components: {
    SetColumn,
    crumbs,
  },
  computed: {
    ...mapState({
      collapsed: (state) => state.user.collapsed,
    }),
    filteredList() {
      let list = []
      for (let key in this.filterForm) {
        if (key == 'reportWorkTime') {
          list.push({
            title: this.filteredFormLable[key],
            text: this.filterForm.reportWorkTimeBegin
              ? moment(this.filterForm.reportWorkTimeBegin).format('YYYY-MM-DD') +
                '-' +
                moment(this.filterForm.reportWorkTimeEnd).format('YYYY-MM-DD')
              : '',
            key,
          })
        } else if (key == 'reportWorkTimeBegin' || key == 'reportWorkTimeEnd') {
        } else {
          list.push({
            title: this.filteredFormLable[key],
            text: this.filterForm[key],
            key,
          })
        }
      }
      return list
    },
    filteredNums() {
      let nums = 0
      for (let key in this.filterForm) {
        if (this.filterForm[key] != '' && this.filterForm[key] != null && this.filterForm[key] != undefined) {
          nums += 1
          if (key == 'reportWorkTimeBegin') {
            nums -= 1
          }
        }
      }
      return nums
    },
    scrollX() {
      let xnum = 0
      for (let item of this.columns) {
        xnum += Number(item.width) || 0
      }
      return xnum + 60
    },
  },
  created() {
    this.initData()
    this.requestData()
  },
  methods: {
    disabledDate(current) {
      let nowMon = new Date()
      if (moment(nowMon).isBefore(moment(current))) {
        return true
      }
      return false
    },
    calendarChange(v, e) {
      this.calendarDate = v[0]
    },
    // 导出
    handleExport(e) {
      let that = this
      // 获取动态列
      let filedKeysList = []
      that.columns.forEach((keys) => {
        filedKeysList.push(keys.dataIndex)
      })
      // filedKeysList.pop()//删除最后一个的操作列
      that.filedKeys = filedKeysList.join(',')
      //设置文件名
      that.fileName = `${
        this.filterForm.reportWorkTimeBegin
          ? moment(this.filterForm.reportWorkTimeBegin).format('YYYY-MM-DD') +
            ' ~ ' +
            moment(this.filterForm.reportWorkTimeEnd).format('YYYY-MM-DD') +
            '计件工资统计'
          : '计件工资统计'
      }`
      if (!e || e.length === 0) {
        that.handleExportAll()
        that.selectExportVisiable = false
      } else {
        that.selectExportTitle = `已选中${e.length}条数据`
        that.selectExportVisiable = true
        that.selectExportParam = {
          selectedList: e,
          fileName: that.fileName, //文件名
          filedKeys: that.filedKeys, //动态列
        }
      }
    },
    handleSelectExport() {
      this.selectExportVisiable = false
      downFilePost('/mess/messProductReport/exportReportPieceRateStatisticsXls', this.selectExportParam).then(
        (data) => {
          if (data.type == 'application/json') {
            const reader = new FileReader() //创建一个FileReader实例
            reader.readAsText(data, 'utf-8') //读取文件,结果用字符串形式表示
            reader.onload = function () {
              //读取完成后,**获取reader.result**
              const msg = JSON.parse(reader.result)
              this.$antdMessage.error(msg.message) //弹出错误提示
            }
            return
          }
          if (!data) {
            this.$antdMessage.error('导出失败')
            return
          }
          if (typeof window.navigator.msSaveBlob !== 'undefined') {
            window.navigator.msSaveBlob(new Blob([data]), this.fileName + '.xls')
          } else {
            let url = window.URL.createObjectURL(new Blob([data]))
            let link = document.createElement('a')
            link.style.display = 'none'
            link.href = url
            link.setAttribute('download', this.fileName + '.xls')
            document.body.appendChild(link)
            link.click()
            document.body.removeChild(link) //下载完成移除元素
            window.URL.revokeObjectURL(url) //释放掉blob对象
          }
        }
      )
    },
    handleExportAll() {
      let that = this
      that.$antdConfirm({
        title: `确定导出全部数据?`,
        onOk() {
          let param = {
            ...that.filterForm,
            ...that.sortForm,
            fileName: that.fileName,
            filedKeys: that.filedKeys,
          }
          for (let key in param) {
            if (!!param[key] || param[key] === 0) {
              // nothing
            } else {
              delete param[key]
            }
          }
          console.log(param, '导出选中数据param')
          downFilePost('/mess/messProductReport/exportReportPieceRateStatisticsXls', param).then((data) => {
            if (data.type == 'application/json') {
              const reader = new FileReader() //创建一个FileReader实例
              reader.readAsText(data, 'utf-8') //读取文件,结果用字符串形式表示
              reader.onload = function () {
                //读取完成后,**获取reader.result**
                const msg = JSON.parse(reader.result)
                that.$antdMessage.error(msg.message) //弹出错误提示
              }
              return
            }
            if (!data) {
              this.$antdMessage.error('导出失败')
              that.selectExportVisiable = false
              return
            }
            if (typeof window.navigator.msSaveBlob !== 'undefined') {
              window.navigator.msSaveBlob(new Blob([data]), that.fileName + '.xls')
              that.selectExportVisiable = false
            } else {
              let url = window.URL.createObjectURL(new Blob([data]))
              let link = document.createElement('a')
              link.style.display = 'none'
              link.href = url
              link.setAttribute('download', that.fileName + '.xls')
              document.body.appendChild(link)
              link.click()
              document.body.removeChild(link) //下载完成移除元素
              window.URL.revokeObjectURL(url) //释放掉blob对象
              that.selectExportVisiable = false
            }
          })
        },
        onCancel() {},
      })
    },
    /* 出入库日期选择 */
    onOk(value) {
      console.log(value)
      if (value.length == 0) {
        this.filterForm[`reportWorkTimeBegin`] = ''
        this.filterForm[`reportWorkTimeEnd`] = ''
        this.filterForm['reportWorkTime'] = ''
        this.handleSearch()
        return
      }
      this.filterForm[`reportWorkTimeBegin`] = moment(value[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
      this.filterForm[`reportWorkTimeEnd`] = moment(value[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
      this.handleSearch()
    },
    // 排序
    tableChange(pagination, filters, sorter, { currentDataSource }) {
      if (sorter.order) {
        let sortType = ''
        if (sorter.order == 'ascend') {
          sortType = 'ASC'
        } else {
          sortType = 'DESC'
        }
        this.sortForm = {
          sortType: sortType,
          sortColumn: sorter.column.sortKey,
        }
        this.requestData()
      } else {
        this.sortForm = {
          sortType: '',
          sortColumn: '',
        }
        this.requestData()
      }
    },
    // 分页
    onChangePage(current, pageSize) {
      this.current = current
      this.pageSize = pageSize
      this.requestData(true)
    },
    onShowSizeChange(current, pageSize) {
      this.current = current
      this.pageSize = pageSize
      this.requestData(true)
    },
    handleSearch(selectedKeys, confirm, dataIndex, clearFilters) {
      this.current = 1
      this.requestData()
    },
    /* 打开筛选 */
    handleShowFilter() {
      this.showFilter = true
    },
    /* 关闭筛选 */
    closeFilter() {
      this.showFilter = false
    },
    /* 确定筛选 */
    handleFilter() {
      this.handleSearch()
      this.showFilter = false
    },
    /* 删除已选 */
    delFiltered(key) {
      if (key == 'reportWorkTime') {
        this.filterForm.reportWorkTimeBegin = ''
        this.filterForm.reportWorkTimeEnd = ''
        this.filterForm[key] = ''
        this.dateForm[key] = null
      } else {
        this.filterForm[key] = ''
      }
    },
    /* 重置筛选 */
    resetFilter() {
      this.filterForm = {
        contractCode: '',
        contractName: '',
        goodsCode: '',
        goodsName: '',
        reportWorkTime: '',
        reportWorkTimeBegin: '',
        reportWorkTimeEnd: '',
      }
      this.dateForm = {}
      this.handleSearch()
    },
    /* 初始/加载设置列 */
    initData() {
      var oldValue = localStorage.getItem(this.BUSI_CONST.Entity.PIECE_RATE_STATISTICS)
      this.columns = getNewColumns(this.columnsValue, JSON.parse(oldValue), actionArr, this.columns)
    },
    /* 请求列表数据 */
    requestData(check) {
      let parameter = {
        pageNo: this.current,
        pageSize: this.pageSize,
        ...this.filterForm,
        ...this.sortForm,
      }
      // 过滤空值
      for (let key in parameter) {
        if (!parameter[key]) {
          delete parameter[key]
        }
      }
      this.initDataTop(parameter)
      API.getPieceRateStatistics(parameter).then((res) => {
        if (res.code == 200) {
          if (res.result.total) {
            this.total = res.result.total
          } else {
            this.total = 0
          }
          this.modelList = res.result.records
          if (check) {
            this.checkBoxStatus()
          }
        }
      })
    },
    // 头部统计数据
    initDataTop(parameter) {
      API.getPieceRateStatisticsAmount(parameter).then((res) => {
        if (res.success) {
          this.topArray[0].number = res.result.totalWagesText || '0'
          this.topArray[1].number = res.result.qualifiedWagesText || '0'
          this.topArray[2].number = res.result.noQualifiedWagesText || '0'
        } else {
          this.$antdMessage.warning(res.message)
        }
      })
    },
    /* 打开设置列面板 */
    showColumn() {
      this.showSetColumn = true
      this.$nextTick(() => {
        this.$refs.SetColumn.paramsData(this.columnsValue, this.BUSI_CONST.Entity.PIECE_RATE_STATISTICS, this.columns)
      })
    },
    /* 设置列 */
    sureBtn(emitArr) {
      this.columns = getNewColumns(this.columnsValue, emitArr, actionArr)
      console.log(this.columns)
      localStorage.setItem(this.BUSI_CONST.Entity.PIECE_RATE_STATISTICS, JSON.stringify(emitArr))
      this.tableKey += 1
    },
    /* 详情 */
    handleDetail(record, path, from) {
      let item = {
        operator: record.operator,
        operatorID: record.operatorID,
        reportWorkTimeBegin: this.filterForm.reportWorkTimeBegin,
        reportWorkTimeEnd: this.filterForm.reportWorkTimeEnd,
      }
      this.$openWay(this, true, path, { item: JSON.stringify(item), from })
    },
    //点击返回按钮
    goBack() {
      console.log('goback')
    },
  },
}
</script>
<style scoped lang="less">
@import '~@/assets/less/public.less';
// @import '~@assets/less/common.less';
.flex(@jc,@ai,@fd:row) {
  display: flex;
  justify-content: @jc;
  align-items: @ai;
  flex-direction: @fd;
}
.header {
  width: 150%;
  margin: -12px -12px @distance4;
}
.backBox {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  .backC {
    cursor: pointer;
    display: flex;
    align-items: center;
  }
}
.j-table-force-nowrap {
  margin-top: @distance1;
}
.btns {
  margin-left: @distance5;
}
.right-btn {
  float: right;
  display: flex;
  justify-content: flex-end;
}
.mg-left {
  margin-left: @distance3;
}
.filter-tit {
  background: #fff;
  border-bottom: 1px solid @greyBorder;
  font-size: @fontSize4;
}
.filter-num {
  color: @normalFont;
}
.filter-body {
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.margin-btn {
  margin-right: @distance5;
}
.filter-tag {
  display: inline-block;
  position: relative;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: @fontSize1;
  line-height: @fontSize1;
  max-width: 100%;
  background: @greyBg;
  color: @titFont;
  cursor: pointer;
  .tag-text {
    display: inline-block;
    padding-right: 20px;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .anticon-close {
    position: absolute;
    right: 8px;
    top: 8px;
  }
}
.tag-wrap:nth-of-type(n + 2) {
  margin-top: 10px;
}
.searchWorkOreder {
  .flex(flex-start, center);
  padding: 8px;
}
// /deep/ .ant-card-body {
//   height: calc(100vh - 214px);
//   overflow: hidden;
//   padding: 20px 16px;
// }
.pubColor {
  font-size: 14px;
  color: #1890ff;
  cursor: pointer;
}

div.topBox {
  display: flex;
  justify-content: space-between;
  align-items: center;
  // margin-bottom: 16px;
  box-sizing: border-box;
  padding: 23px 0;
  background: #fff;
  div.itemBox {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    box-sizing: border-box;
    height: 44px;
    position: relative;
    border-right: 1px solid #eeeeee;

    div.rightBox {
      text-align: center;
      height: 44px;
      cursor: pointer;
      display: flex;
      align-items: flex-start;
      flex-direction: column;
      justify-content: flex-start;
      margin-left: 16px;
      div.rightTop {
        font-size: 24px;
        color: #191f25;
        line-height: 24px;
        margin-top: 12px;
      }

      div.rightBot {
        font-size: 14px;
        color: #888888;
      }
    }
  }
}
.topBox .itemBox:last-child {
  border: none;
}
.topSearch {
  padding: 0 0 10px 38px;
}
</style>
